﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    EnableViewState="true" EnableSessionState="True" CodeBehind="AddContracts.aspx.cs"
    Inherits="Client_Revenue.AddContracts" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <link type="text/css" href="Styles/datagrid.css" rel="stylesheet" />
    <link type="text/css" href="Styles/detailgrid.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        client contract setup
    </h2>
    <table style="border-style: double; text-align: justify; vertical-align: text-top;
        padding: 0px; margin: 20px 20px 20px 0px;">
        <tr>
            <td>
                <table style="border-style: dotted; border-width: thin; text-align: justify; vertical-align: text-top;
                    padding: 0px; vertical-align: text-top;">
                    <tr>
                        <td>
                            Client Name&nbsp;&nbsp;
                            <asp:DropDownList ID="ddClient" runat="server" />
                        </td>
                        <td>
                            Date
                            <asp:TextBox ID="txtStartDate" runat="server" Width="75" />
                            Head Count&nbsp;&nbsp;
                            <asp:TextBox ID="txtHeadCount" runat="server" Width="54px" Text="0" />
                            Estimated Revenue ($)&nbsp;&nbsp;
                            <asp:TextBox ID="txtEstimatedRev" runat="server" Width="75" Text="0.00" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <%--BizLines--%>
        <tr>
            <td>
                <asp:Panel ID="pnlBizLines" runat="server">
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                            <table style="text-align: justify; vertical-align: text-top; padding: 0px; vertical-align: text-top;
                                width: 100%;">
                                <tr>
                                    <td colspan="5" style="text-align: center;">
                                        <h5>
                                            Business Lines</h5>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <h6>
                                            Business Line</h6>
                                        <asp:DropDownList ID="ddBizLine" runat="server" />
                                    </td>
                                    <td>
                                        <h6>
                                            Carrier</h6>
                                        <asp:DropDownList ID="ddCarrier" runat="server" />
                                    </td>
                                    <td>
                                        <h6>
                                            Insurance Type</h6>
                                        <asp:DropDownList ID="ddInsuType" runat="server" />
                                    </td>
                                    <td>
                                        <h6>
                                            Commission (%)</h6>
                                        <asp:TextBox ID="txtLoBComm" runat="server" Width="75" Text="0.00" />
                                    </td>
                                    <td style="font-weight: normal; text-align: center; vertical-align: text-bottom">
                                        <asp:LinkButton ID="BtnAddBizLine" runat="server" Text="Add Line" OnClick="BtnAddBizLine_Click" />
                                    </td>
                                </tr>
                            </table>
                        </ContentTemplate>
                        <Triggers>
                       <%-- <asp:AsyncPostBackTrigger ControlID="BtnAddBizLine" />--%>
                            <asp:PostBackTrigger ControlID="BtnAddBizLine" />
                        </Triggers>
                    </asp:UpdatePanel>
                    <div>
                        <div>
                            <h6>
                                Contract Business Lines</h6>
                        </div>
                        <div>
                            <asp:GridView ID="gvBizLines" runat="server" CssClass="datagrid" AutoGenerateColumns="True">
                               <%-- <Columns>
                                    <asp:TemplateField HeaderText="Business Line" SortExpression="LoBName">
                                        <ItemTemplate>
                                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("LoBName") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Carrier" SortExpression="CarrierName">
                                        <ItemTemplate>
                                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("CarrierName") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                     <asp:TemplateField HeaderText="Insurance Type" SortExpression="InsuranceTypeName">
                                        <ItemTemplate>
                                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("InsuranceTypeName") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                       <asp:TemplateField HeaderText="Commission(%)" SortExpression="Commission">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtComm" runat="server" Text='<%# Bind("Commission") %>' 
                                                Width="50"></asp:TextBox>
                                        </EditItemTemplate>
                                     <ItemTemplate>
                                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("Commission") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>--%>
                            </asp:GridView>
                        </div>
                    </div>
                </asp:Panel>
            </td>
        </tr>
        <%--end of BizLines--%>
        <%--Producers--%>
        <tr>
            <td>
                <asp:Panel ID="pnlSalesPersonels" runat="server">
                    <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                            <table style="border-style: dashed; text-align: justify; vertical-align: text-top;
                                padding: 0px; vertical-align: text-top; width: 100%;">
                                <tr>
                                    <td colspan="5" style="text-align: center;">
                                        <h5>
                                            Dominium Employees</h5>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <h6>
                                            Employee</h6>
                                        <asp:DropDownList ID="ddEmployee" runat="server" />
                                    </td>
                                    <td>
                                        <h6>
                                            Sales Role</h6>
                                        <asp:DropDownList ID="ddProducerRole" runat="server" />
                                    </td>
                                    <td>
                                        <h6>
                                            Commission (%)</h6>
                                        <asp:TextBox ID="txtEmployeeComm" runat="server" Width="75" Text="0.00" />
                                    </td>
                                    <td>
                                        <h6>
                                            Fee($)</h6>
                                        <asp:TextBox ID="txtProdFee" runat="server" Text="0.00" />
                                    </td>
                                    <td>
                                        <asp:LinkButton ID="BtnAddProducer" runat="server" Text="Add Producer" OnClick="BtnAddProducer_Click" />
                                    </td>
                                </tr>
                            </table>
                        </ContentTemplate>
                        <Triggers>  
                        <asp:PostBackTrigger ControlID="BtnAddProducer" />
                      <%--  <asp:AsyncPostBackTrigger ControlID="BtnAddProducer" />--%>
                        </Triggers>
                    </asp:UpdatePanel>
                    <div>
                        <div>
                            <h6>
                                Contract sales persons</h6>
                        </div>
                        <div>
                            <asp:GridView ID="gvProducers" runat="server" CssClass="datagrid" AutoGenerateColumns="True"/>
                        </div>
                    </div>
                </asp:Panel>
            </td>
        </tr>
        <%--End Producers--%>
        <tr>
            <td>
                <table style="text-align: justify; vertical-align: text-top; padding: 0px; vertical-align: text-top;
                    width: 100%" cellspacing="10">
                    <tr>
                        <td>
                            <asp:TextBox ID="txtContractNotes" runat="server" Rows="2" TextMode="MultiLine" Width="541px" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <table style="text-align: justify; vertical-align: text-top; padding: 0px; vertical-align: text-top;
                    width: 100%" cellspacing="10">
                    <tr>
                        <td align="left">
                            <asp:Button ID="btnSaveContract" runat="server" Text="Create Contract" OnClick="btnSaveContract_Click" />
                        </td>
                        <td align="left">
                            <asp:Button ID="btnReset" runat="server" Text="Cancel/Clear" Width="115px" OnClick="btnReset_Click" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</asp:Content>
